package com.dy.design_pattern_study.state_pattern.dome3.impl;

import com.dy.design_pattern_study.state_pattern.dome3.State;
import com.dy.design_pattern_study.state_pattern.dome3.entry.Work;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-06
 * @Content 中午状态
 */
public class NoonState extends State {
    @Override
    public void writeProgram(Work work) {
        if (work.getHour() < 13) {
            System.out.println("中午，当前时间： = " + work.getHour());
        }else {
            //超过 13 点，就进入 下午 状态
            work.setState(new AfternoonState());
            work.writeProgram();

        }
    }
}
